package com.tizona.entity;

import java.math.BigDecimal;
import java.util.Set;
import java.util.HashMap;
import java.sql.Timestamp;

/**
 * Created by Vitaliy Kim.
 * Date: 23.08.2005
 * Time: 13:06:08
 */
public class Session {

    /** identifier field */
    private Long sessionId;

    /** nullable persistent field */
    private BigDecimal download;

    /** nullable persistent field */
    private BigDecimal upload;

    /** nullable persistent field */
    private Timestamp start;

    /** nullable persistent field */
    private Timestamp stop;

    /** persistent field */
    private short status;

    /** persistent field */
    private Se se;

    /** persistent field */
    private Set <Split> sessionSplits;

    /** persistent field */
    public HashMap<Long,SessionTraffic> sessiontraffic = new HashMap <Long,SessionTraffic> ();

    /*Default constructor*/

    public Session() {
    }

    public Session(Long sessionId) {
        this.sessionId = sessionId;
    }

    public Session(Long sessionId, Timestamp start, Timestamp stop, short status) {
        this.sessionId = sessionId;
        this.start = start;
        this.stop = stop;
        this.status = status;
    }


    public HashMap<Long, SessionTraffic> getSessiontraffic() {
        return sessiontraffic;
    }

    public void setSessiontraffic(HashMap<Long, SessionTraffic> sessiontraffic) {
        this.sessiontraffic = sessiontraffic;
    }

    public Timestamp getStart() {
        return start;
    }

    public void setStart(Timestamp start) {
        this.start = start;
    }

    public Timestamp getStop() {
        return stop;
    }

    public void setStop(Timestamp stop) {
        this.stop = stop;
    }

    public Long getSessionId() {
        return sessionId;
    }

    public void setSessionId(Long sessionId) {
        this.sessionId = sessionId;
    }

    public BigDecimal getDownload() {
        return download;
    }

    public void setDownload(BigDecimal download) {
        this.download = download;
    }

    public BigDecimal getUpload() {
        return upload;
    }

    public void setUpload(BigDecimal upload) {
        this.upload = upload;
    }

    public Set <Split> getSessionSplits() {
        return sessionSplits;
    }

    public void setSessionSplits(Set <Split> sessionSplits) {
        this.sessionSplits = sessionSplits;
    }

    public Se getSe() {
        return se;
    }

    public void setSe(Se se) {
        this.se = se;
    }

    public short getStatus() {
        return status;
    }

    public void setStatus(short status) {
        this.status = status;
    }

    public boolean isActive() {
        return (this.status == 1);
    }

}
